
<?php
turnplaner::controllertest();
class turnplaner extends Zend_Controller_Action
{
    public function controllertest()
    {
		$lat = $_GET['lat'];
		$lng = $_GET['lng'];
		//$f = file_get_contents('http://maps.google.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&sensor=false');
		$f = file_get_contents('http://maps.google.com/maps/api/elevation/json?locations=' . $lat . ',' . $lng . '&sensor=false');
		//$result = explode(",",$f);
		$result = explode(" ",$f);
		$result = explode(",",$result[22]);
		echo $result[0];
		

		$kords = new Application_Model_Koordinaten();
		$kords->setLat($lat);
		$kords->setLng($lng);
		$kords->setHohe($result[0]);
		echo $kords->getHohe();
		
		$mapper = new Application_Model_Mapper_KoordinatenMapper();
		$mapper->add($kords);
    }
}
		
		